package designPattern.decorator;

public class CoffeeBar {
    public static void main(String[] args) {

        //装饰者模式下的订单：2份巧克力 + 一份牛奶的LongBlack

        //1.点一份LongBlack
        Drink order = new LongBlack();
        System.out.println("费用1="+order.cost());
        System.out.println("描述="+order.getDes());

        //2.加一份牛奶
        order = new Milk(order);
        System.out.println("order加一分牛奶的费用1="+order.cost());
        System.out.println("描述="+order.getDes());

        //3.加一分巧克力
        order = new Chocolate(order);
        System.out.println("order加一分牛奶的费用再加一份巧克力费用="+order.cost());
        System.out.println("描述="+order.getDes());

        //4.再加一分巧克力
        order = new Chocolate(order);
        System.out.println("order加一分牛奶的费用再加两份巧克力费用="+order.cost());
        System.out.println("描述="+order.getDes());

    }
}
